package com.jctrip.hotel.source.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.jctrip.hotel.source.model.CnBooking.req.BaseRequest;
import com.jctrip.hotel.source.model.CnBooking.resp.QueryCityResp;

/**
 * @Author henry
 * @Date 2023/7/3 21:57
 * @Description
 */
@FeignClient(name = "CNBEClient", url = "${feign.url.cnbe}")
@RequestMapping(headers = {"Content-Type=application/xml", "Accept-Encoding=gzip, deflate"})
public interface CNBEClient {

    @PostMapping(
            "StaticInfoQueryXml.aspx?ActionName=CityQuery")
    QueryCityResp getCity(@RequestBody BaseRequest request, @RequestParam("auth") String auth);

    @PostMapping(
            value = "/RESTServer.asmx/GetXmlData",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    String callCNBE(@RequestBody MultiValueMap<String,?> postData);
}
